home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CBASE102.ARJ / BGETH.C < prev    next >
Text File  |  1991-09-23  |  1KB  |  58 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "@(#)bgeth.c    1.5 - 91/09/23" */
  5.  
  6. #include <ansi.h>
  7.  
  8. /* ansi headers */
  9. #ifdef AC_STDDEF
  10. #include <stddef.h>
  11. #endif
  12.  
  13. /* local headers */
  14. #include "blkio_.h"
  15.  
  16. /*man---------------------------------------------------------------------------
  17. NAME
  18.      bgeth - get the header from a block file
  19.  
  20. SYNOPSIS
  21.      #include <blkio.h>
  22.  
  23.      int bgeth(bp, buf)
  24.      BLKFILE *bp;
  25.      void *buf;
  26.  
  27. DESCRIPTION
  28.      The bgeth function reads the header from the block file
  29.      associated with BLKFILE pointer bp.  buf must point to a storage
  30.      area at least as large as the header size for bp.
  31.  
  32.      bgeth will fail if one or more of the following is true:
  33.  
  34.      [EINVAL]       bp is not a valid block file.
  35.      [EINVAL]       buf is NULL.
  36.      [BEEOF]        bp is empty.
  37.      [BEEOF]        End of file encountered within header.
  38.      [BENOPEN]      bp is not open for reading.
  39.  
  40. SEE ALSO
  41.      bgetb, bgethf, bputh.
  42.  
  43. DIAGNOSTICS
  44.      Upon successful completion, a value of 0 is returned.  Otherwise,
  45.      a value of -1 is returned, and errno set to indicate the error.
  46.  
  47. ------------------------------------------------------------------------------*/
  48. #ifdef AC_PROTO
  49. int bgeth(BLKFILE *bp, void *buf)
  50. #else
  51. int bgeth(bp, buf)
  52. BLKFILE *bp;
  53. void *buf;
  54. #endif
  55. {
  56.     return bgethf(bp, (size_t)0, buf, bp->hdrsize);
  57. }
  58.